# 请设计一个decorator，它可作用于任何函数上，并打印该函数的执行时间：
import time
def decorator(fn):
    def inner(*args, **kwargs):
        start = time.time()
        fn(*args, **kwargs)
        end = time.time()
        print('{}'.format(end-start))
        # return end - start
    return inner

@decorator
def func1():
    time.sleep(0.5)
    print("func1,sleep 0.5 seconds")

@decorator
def func2():
    time.sleep(0.2)
    print('func2,sleep 0.2 seconds')

func1()
func2()

